<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var a = function () {
            console.log(a);
            a = 2;
        }
        a()
        console.log(a)
        //以上代码执行步骤
        // 函数表达式声明的变量提升，然后执行函数a
        // 首先打印a，是函数表达式，再重新给变量a赋值为2的
        // var a;
        // a = function () {
        //     console.log(a);
        //     a = 2;
        // }
        // a();
    </script>
</body>
</html>